//
//  ToolClass.h
//  YunYuZhiJia
//
//  Created by 苏荷 on 14/12/3.
//  Copyright (c) 2014年 苏荷. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import "AppDelegate.h"
#import <CommonCrypto/CommonDigest.h>
#import "VMacros.h"

@interface ToolClass : NSObject
+ (BOOL)isFirstOpenApp:(NSString *)key;
+ (CGSize)sizeWithFont:(UIFont *)font maxSize:(CGSize)maxSize String:(NSString *)string;
+ (void)bigShowMessage:(NSString *)message;
+ (UIImage *)scaleToSize:(UIImage *)originImage;
+ (void)showAlertTitle:(NSString *)title Message:(NSString *)message;
//保存历史记录 
+ (void)saveHistory:(NSMutableArray *)arr;
+ (NSMutableArray *)getHistory;

+ (UIViewController*)viewController:(UIView *)view;
+(AppDelegate *)appdelegate;

//判断邮箱是否可用
+(BOOL)isValidateEmail:(NSString *)email;


+ (NSString *)getVerificationCode;

//提示成功提问 成功收藏 成功点赞
+ (void)tipAnimationWith:(NSString *)title;
//判断合法的电话号码
+ (BOOL)checkTel:(NSString *)str;

//判断输入是否为空格
+(BOOL)isEmpty:(NSString *) str;

//交互式请求登陆
+(BOOL) isLogin:(UIViewController *)viewController;
//获取用户id
+ (NSString * )getUserId;
//获取用户token
+(NSString *)getToken;

//判断是否为整形数字
+ (BOOL)isPureInt:(NSString *)string;
+ (BOOL)isValidateName:(NSString *)name;
+(NSString *)urlencode:(NSString *) str;

+ (NSDictionary *)pictureWidthAndHeight:(NSString *)str;

//压缩图片
+ (UIImage *)imageWithMaxSide:(CGFloat)length sourceImage:(UIImage *)image;

// 根据颜色16进制数值得到UIColor
+ (UIColor *)colorFromHexRGB:(NSString *)inColorString;
+ (NSString *)md5:(NSString *)str;

+(NSString *)number:(float) price;

+(int)compareOneDay:(NSDate *)oneDay withAnotherDay:(NSDate *)anotherDay;
//判断字符串是否为空
+ (BOOL) isBlankString:(NSString *)string;

#pragma mark--计算字数
+ (int)countWord:(NSString*)s;

//判断是否为字典类型
+(BOOL)isBlankDic:(NSDictionary *)dic;
//阴影
+ (void)putShadowOnView:(UIView *)view Radius:(CGFloat)radius Color:(CGColorRef)color ShadowRadius:(CGFloat)sRadius Opacity:(float)opacity;
//用颜色来生成图片
+(UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size;

//时间字符自定义
+(NSString *)dateformatter:(NSString *)dateStr;

//手机号中间用****代替
+(NSString *)numberSuitScanf:(NSString*)number;


+ (NSString *)weekdayStringFromDate:(NSString* )inputDate;

//NSDate转NSString
+ (NSString *)stringFromDate:(NSDate *)date formate:(NSString *)formatStr;

//NSString转NSDate
+ (NSDate *)dateFromString:(NSString *)dateString formate:(NSString *)formatStr;


// 时间戳转时间
+ (NSString *)getDateStringWithTimeStr:(NSString *)str formate:(NSString *)formatStr;
//时间字符自定义
+(NSString *)dateformatter:(NSString *)dateStr formattor:(NSString *)formattor;

//获取当前周时间段
+(NSString *)getWeekTime;

//获取昨天年月
+(NSString *)getYearAndMonth;

//获取当前年
+(int)getYear;

//判读身份证号正确
+(BOOL)CheckIsIdentityCard: (NSString *)identityCard;
//设置flowlayout
+(UICollectionViewFlowLayout *)setUICollectionViewFlowLayout:(UICollectionViewFlowLayout *)flow Width:(float) width High:(float) high
                                                 minHspacing:(float) minhs minVspacing:(float) minvs UiedgeUp:(float) up Uiedgeleft:(float) left Uiedgebottom:(float)bottom Uiedgeright:(float)right Scdirection:(BOOL) direction;
//自定义搜索框
+(UISearchBar *)customerSearchBar;
//时间戳转时间
+(NSString *)stringformat:(NSString *)str;
//JSON格式的字符串  
+(id)dictionaryWithJsonString:(NSString *)jsonString;

//设置阴影
+(void)setShadow:(UIView *)view color:(UIColor *)color;

//判断输入是否包含表情
+ (BOOL)isContainsTwoEmoji:(NSString *)string;

@end
